<%@ page language="java" import="java.util.*" import="modelo.Departamento" pageEncoding="ISO-8859-1"%>
<%@taglib prefix="disp" uri="http://displaytag.sf.net"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
request.setAttribute("path",path);
//List<Departamento> deps = (ArrayList<Departamento>) request.getAttribute("deps");
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">

    <title>Lista de Departamentos</title>

	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">

	<link rel="stylesheet" type="text/css" href="${path}/css/displaytag.css">

  </head>

  <body>

 <h2 style="text-align:center;">Listado De Departamentos</h2>

 <br>  <a href="http://127.0.0.1:8080/JspWebProject/"> <button type="button"  style ="text-decoration: none;">Volver al inicio</button></a>
 <br><br>

<disp:table id="dep" name="${deps}" requestURI="servlet/listado">
	<disp:column title="ID Depto" value="${dep.idDepto}" sortable="true" />
	<disp:column title="Nombre" value="${dep.nombre}" />
	<disp:column title="Descripcion" value="${dep.descripDepto}" />
	<disp:column title="Ubicacion" value="${dep.ubicacion}" />
	<disp:column title="Telefono" value="${dep.telefono}" />
	<disp:column title="Id Gerenecia" >

	<c:choose>
		<c:when test="${dep.idGenerecia == 1}">
		Gerencia Sistema
		</c:when>
		<c:otherwise>
    		Otra Gerencia
		</c:otherwise>
	</c:choose>
	</disp:column>
</disp:table>

  <a href="http://127.0.0.1:8080/JspWebProject/"> <button type="button"  style ="text-decoration: none;">Volver al inicio</button></a>

<br>
  </body>
</html>
